All right, so in the last part of this course, we finish up our play button, which puts us into our
actual game level and what we're going to do now is create our settings, settings, widget settings,
page.
So for this, we're going to need to create a brand new widget, but we can actually just duplicate
our menu buttons widget because that'll give us our buttons with all of our text settings and our animations
already.
And then we could just duplicate stuff and edit stuff from there.
So that's what we're going to do.
Let's go back to our content browser here, go to our main menu folder.
I'm going to grab the menu buttons, right.
Click and duplicate this.
I'm just going to call this settings menu and open this up and I'm just going to start changing some
stuff here.
So first off, we've got our three buttons here.
I'm going to retitle this one low because this is going to be our low settings button.
We're going to have a medium settings button.
We're going to have a high setting.
And we're going to have an ultra setting which we are going to need to create a new button for, so
let's just copy one of these buttons and paste it into our vertical box.
And now we can just re-enter this text here and say.
Or is it ultra?
Right there.
And that'll be enough for here.
Now let's see, this button doesn't have a hover animation on it.
Let's create a new hover animation.
We'll duplicate this make hover.
For.
And so we'll select this grammar block here and replace it with the ultra text block just like so.
And next, let's go into our graph, our blueprint graph here and let's clean up some of this stuff.
Mainly are on clicked buttons here.
We're going to I'm going to get rid of these because this is just like play game code and quick game
codes.
We don't want that stuff.
So we've just got our three hover and hover button code here.
So let's add some of that code for our ultra setting so that when we hover over this, we will actually
get our nice hover animation.
So we're going to add an event on hovered an event on uncovered.
Move these down, just like we did previously, will duplicate.
Our planet in code and put in our new animation, which is Hubber for.
Trying this in here.
That is very nice, and then we have one more button that we need to create and that's going to be a
back button so we can actually navigate back to the main menu after we've finished setting our settings
and stuff like that.
So once again, we'll copy a button, paste it into the vertical box, and I'm just going to title this
back.
Just like so and now I'm going to adjust the alignment of this, so let's grab the button itself here
and in the details panel, we've got horizontal alignment and I'm just going to press this left align
button here.
And now you can see it's just kind of off to the side here, which is much better placement for this
button.
And now what I'm going to do is I'm going to adjust the top padding, so that's also a little bit lower
than the rest of these.
So rather than having that at seven, I'll try something like 20, maybe a bit more like one hundred
fifty.
I'm going to go with seventy five.
Seventy five.
Seems like some pretty good placement and I'm generally happy with that.
So compile safe.
We'll add one more hover for for this back button.
So this will be hover five.
It's like that once again, also like this selective animation track, select the new text that we want
to replace it with.
And a place that's very nice and I will add our hover code, so we'll select the back button at an event
on Hovered.
And events on uncovered.
Move them down.
Duplicate our code.
And then just replace the animation reference.
With her four, five.
There we go.
Very nice.
So now we need to actually program the functions of all these different buttons, so.
Let's just select our low setting button here and scroll down and create an event on Clicked.
So this is going to be pretty simple to do, but there's a lot of room for you to make this more advanced
and complicated if you want to.
So obviously, as you can see, we're doing this in a pretty simple way.
We just have low, medium, high and ultra settings, which will adjust a vast variety of individual
scalability settings inside of your game.
Automatically Unreal Engine makes it very easy to adjust to scalability settings and stuff.
You can do it in just like three nodes.
So I guess I'll just show you kind of what what I'm talking about here.
So if we go on collect and create a new node called Get Game User settings, we now have access to a
vast variety of scalability settings that we can adjust for users.
So after the return value here, if you just search for set, it is a big, big, big list of all of
these different scalability settings here.
We've got apply hardware, benchmark results, apply settings, get different resolution, lots of gets
and is is.
But we've got all this stuff like set a. aliasing quality set audio quality set dynamic resolution enabled
set texture quality shadow quality shading quality screen resolution.
There's tons and tons and tons of stuff and we also have the option to set basically the overall.
So if we go just set overall scalability level right here, this will take all of our scalability and
adjust it on a scale of one to or zero to four.
I was going to say one to five, but a zero to four technically you've got zero is low, one is medium,
two is high, three is epic.
And then for cinematic.
And I'm not I haven't created a button here for a cinematic level setting because in all of my own games,
whenever I get into using the cinematic quality stuff, sometimes it gets a little buggy and the game
will start crashing kind of at the point where you go from epic quality scalability to cinematic quality
scalability.
The visual difference is.
Essentially nonexistent, but the performance goes down quite noticeably, so that's just something
to keep in mind.
You might need to.
Adjust some things for your players, depending on what kind of game you're working on, you might just
need to experiment with stuff.
But to keep this simple for each button, we're just going to have it set the overall scalability level
to something between zero and three.
If you were working on a really big game, something really complicated, something complex, advanced,
that kind of thing, then what you could do, you could bring in something like a.
Let's say.
So like a combo box here and you could have a combo box for each major setting, like let's say you
have a combo box for anti aliasing and for shading level and texture quality, all those kind of, you
know, different main scalability settings.
And inside the box, you know, you can set how high you want the scalability to be for each of these
individual settings like you would see in most the games where they allow you to customize basically
every single scalability setting to balance everything exactly how you want as a player.
So you're working on a larger scale game.
That's that I would recommend doing.
And you would do it in a very similar way with just these few nodes.
You know, let's say you've got an anti aliasing button.
You know, you could just say set anti aliasing quality and just set it to something between zero and
four, depending on what quality the button is or the slider or whatever you have going on.
So.
With that rant aside, to do what we need to do is very simple, all we need to do is grab a button
like we did, make our event, get our game user settings and set the overall scalability level.
Now we're going to set this to zero for the low setting, which is what this is, and then all we need
to do is grab the return value and just go to apply settings.
Just plug this in here, we can leave check for command line overrides, we can leave that how it is,
and now it'll just work.
The scalability will be applied when we press this button.
One thing to keep in mind is no matter what settings you set, you always have to use the apply settings
node before those settings will actually be applied.
So just something to keep in mind.
So now let's just go in and add.
The code for the rest of her buttons here, so let's go to the medium quality on clicked duplicate this
here and instead of sending this to zero, set this time to one that.
For the high sending button, when it is clicked, we will set the quality to to.
And ultra.
We'll go up to three and obviously you can add one more button if you want to, for the ultra or cinematic
quality that is completely up to you.
And you can get much more granular if you like.
But this is it for the actual code in our settings menu.
And I'll just I'll just demo this for you real quick by just adding it into our game here so that we
can see it in action.
Actually, here's what I'll do.
I'll just replace the menu background here with the settings menu.
And now we can see if we can go to low quality, medium quality, high and ultra, and you can see it
changing when we click all of these.
So that's super cool.
Super awesome and.
I think one more thing that we're going to do in this video, first of all, I'm going to undo that
stuff that I did there.
And I think I'll just add a text at the top here that just says settings, just kind of a header text.
So I'll just add a text block.
I could just put it in the vertical box even and move it up to the top here.
I can add a little bit of bottom padding, maybe 15 or 20 bottom padding this up a little again here.
Can adjust the justification of the text to be centered and just titled this.
Settings.
Just like that, and that'll be very nice.
And in the next part, we're going to get into integrating this settings menu that we've just programmed
with the main menu so that we can go from the main menu to the settings menu and then we can use the
back button if we want to get back to the main menu and then play or quit from there.
So that is it for this part.
And I will see you in the next video.